<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>商品结算页面</title>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <link rel="stylesheet" href="../../web/css/public_shop_cart.css">
    <link rel="stylesheet" type="text/css" href="http://css.huangwx.cn/css/sweetalert.css">
    <script type="text/javascript" src="http://css.huangwx.cn/js/sweetalert-dev.js"></script>
    <style>
        .public-shop-account > .content {
            width: 1200px;
            background-color: #fff;
            margin: 20px auto;
            display: flex;
            flex-direction: column;
        }
        .public-shop-account > .content >.shop-account-head{
            margin: 10px 5px;
            font-size: 16px;
        }
        .public-shop-account > .content >.shop-account-info{
            border: 1px solid #ccc;
            padding: 10px;
        }
        .public-shop-account > .content >.shop-account-info > .edit-address{
            border-bottom: 1px solid #ccc;
        }
        .public-shop-account > .content >.shop-account-info > .edit-address >.address-head{
            display: flex;
            justify-content: space-between;
            padding: 10px 0;
        }
        .public-shop-account > .content >.shop-account-info > .edit-address >.address-head >span{
            font-size: 14px;
            font-weight: bold;
        }
        .public-shop-account > .content >.shop-account-info > .edit-address >.address-head >a{
            color: #005ea7;
            font-size: 12px;
        }
        .public-shop-account > .content >.shop-account-info > .edit-address >.address-head >a:hover{
            color: #E2231A;
        }
        .public-shop-account > .content >.shop-account-info > .edit-address > .address-info{
            display: flex;
            padding: 20px;
            justify-content: space-between;
        }
        .public-shop-account > .content >.shop-account-info > .edit-address > .address-info >span:first-of-type{
            width: 120px;
            height: 30px;
            border: 3px solid #E2231A;
            text-align: center;
            margin-right: 10px;
            font-size: 16px;
            line-height: 30px;
        }
        .public-shop-account > .content >.shop-account-info > .edit-pay > .pay-head{
            font-size: 14px;
            font-weight: bold;
            padding: 20px 0;
        }
        .public-shop-account > .content >.shop-account-info > .edit-pay >.pay-info{
            display: flex;
            align-items: center;
        }
        .public-shop-account > .content >.shop-account-info > .edit-pay >.pay-info >span{
            width: 100px;
            height: 30px;
            border: 2px solid #ccc;
            margin: 10px;
            text-align: center;
            line-height: 30px;
        }
        .public-shop-account > .content >.shop-account-info > .edit-pay >.pay-info >span:hover{
            border: 2px solid #E2231A;
        }
        .public-shop-account > .content > .shop-account-detail > .account-address{
            padding: 20px;
            display: grid;
            grid-template-columns: 1fr 150px;
            grid-template-rows: repeat(3, 30px);
            justify-items: end;
        }
        .public-shop-account > .content > .shop-account-detail > .account-address i{
            font-style: normal;
            color: #E2231A;
        }
        .public-shop-account > .content > .shop-account-detail > .account-pay{
            height: 80px;
            background-color: #eee;
            border: 1px solid #ccc;
            display: flex;
            padding: 10px 20px 0 0;
            flex-direction: column;
            align-items: flex-end;
        }
        .public-shop-account > .content > .shop-account-detail > .account-pay > span > i{
            font-style: normal;
            font-size: 20px;
            color: #E2231A;
        }
        .public-shop-account > .content > .shop-account-detail > .account-btn{
            display: flex;
            justify-content: flex-end;
        }
        .public-shop-account > .content > .shop-account-detail > .account-btn > button{
            border: none;
            background-color: #E2231A;
            color: #fff;
            width: 120px;
            height: 40px;
            font-size: 16px;
            font-weight: bold;
            margin: 10px 0;
        }
        .dropdown {
            position: relative;
            display: inline-block;
        }
        .dropdown-content {
            display: none;
            position: absolute;
            background-color: #f9f9f9;
            min-width: 160px;
            box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
            padding: 12px 16px;
        }
        .dropdown:hover .dropdown-content {
            display: block;
        }
    </style>
</head>
<body>

<nav class="public-header">
    <span>
        欢迎来到共享农庄平台
    </span>
</nav>

<div class="public-shop-account">
    <div class="content">
        <div class="shop-account-head"> 填写并核对订单信息 </div>
        <div class="shop-account-info">
            <div class="edit-address">
                <div class="address-head">
                    <span>收货人信息</span>
                </div>
                <div class="address-info">
                    <span>家里</span>
                    <%-- <span>省xx市xx街道</span>--%>
                    <select id="address">
                        <option value="">请选择地址</option>
                        <option value="1">广东省深圳市南山区</option>
                        <option value="2">广东省广州市天河区</option>
                        <option value="3">江苏省南京市鼓楼区 </option>
                        <option value="4">北京市海淀区中关村</option>
                    </select>
                </div>
            </div>
            <div class="edit-pay">
                <div class="pay-head">支付方式</div>
                <div class="pay-info">
                    <%--<span>货到付款</span>
                    <span>在线支付</span>--%>
                    <select id="address">
                        <option value="1">货到付款</option>
                        <option value="2">在线支付</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="shop-account-detail">
            <div class="account-address">
                &nbsp;&nbsp;&nbsp; <p><span id="count" style="color: #E2231A"></span> 件商品</p>
                <br/>
                &nbsp;&nbsp;&nbsp;<p>总商品金额：<span id = "sum" style="color: #E2231A"></span>&yen;</p>
                <br/>
                &nbsp;&nbsp;&nbsp;<p>运费：<span id = "fee" style="color: #E2231A"></span>&yen;</p>
            </div>
            <div class="account-btn" onclick="a()"><button>提交订单</button></div>
        </div>
    </div>
</div>
<footer class="public-footer">
    <div align="center">
        <a href="">简介</a>
        <a href="">联系我们</a>
        <a href="">招聘信息</a>
        <a href="">友情链接</a>
        <a href="">用户服务协议</a>
        <a href="">隐私权声明</a>
        <a href="">法律投诉声明</a>
    </div>
    <div align="center">
        <p>2019 2023.com. All rights reserved . 共享农庄有限公司 版权所有</p>
        <p>皖ICP证150110号 京ICP备14323013号-2 皖公网安备110108024357788号</p>
        <p>违法和不良信息举报电话: 0551-1234567 举报邮箱: admin@baidu.com</p>
    </div>
</footer>
<script type="text/javascript">
    var data1;
    var data2;
    $(document).ready(function() {
        var myData = {
        };
        $.ajax({
            contentType: "application/json;charset=UTF-8",//必须
            url: "http://localhost:8080/product/getSum",
            type: "post",
            data: JSON.stringify(myData),
            success: function (response) {
                var jsonobj = eval(response);
                data1= JSON.stringify(jsonobj)//将json对象转化成字符串
                $("#sum").html(data1);
            },
            error:function (){
                alert("错误");
            }
        });
        var myData1 = {
        };
        $.ajax({
            contentType: "application/json;charset=UTF-8",//必须
            url: "http://localhost:8080/product/getQuantity",
            type: "post",
            data: JSON.stringify(myData),
            success: function (response) {
                var jsonobj = eval(response);
                var data2 = JSON.stringify(jsonobj)//将json对象转化成字符串
                $("#count").html(data2);
                $("#fee").html(data2*10);
            },
            error:function (){
                alert("错误");
            }
        });
    });

    function a(){
        swal("支付成功");
    }
</script>
</body>
</html>
